home *** CD-ROM | disk | FTP | other *** search
-
- function units_lbot_setup()
- units_setup(4,false,ENET_EFFECT_PS_SETUPSMOKE_SMALL,ENET_EFFECT_GEOMETRY_SMALLROBOTSHADOW)
- end
-
- function units_lbot_resetup()
- units_setup(4,false,nil,ENET_EFFECT_GEOMETRY_SMALLROBOTSHADOW)
- end
-
- function units_lbot_select()
- units_select(12,1)
- end
-
- function units_lbot_unselect()
- units_unselect()
- end
-
- function units_lbot_selectenemy()
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
- end
-
- function units_lbot_damaged()
- uniGetExecutor():applyDamage(uniGetLife())
- end
-
- function units_lbot_highlight()
- uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
- end
-
- function units_lbot_explode()
- units_explode_small2()
- end
-
- function units_lbot_move()
- local unit = uniGetExecutor()
- local sound = unit:play3DSound(units_getRandomSoundName(SND_LBOT,SNDT_MOVE),1)
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNIT,MATH_PI * 1.8))
- local steps = {}
- local stepsmoke = {}
- local i = 0;
- for i = 0,2 do
- steps[i] = unit:getBone(ENBT_STEPEMITTER,i):addSimpleEffect(ENET_EFFECT_DYNAMICGEOMETRY_WHEELSTEPSEMITTER)
- stepsmoke[i] = unit:getBone(ENBT_STEPEMITTER,i):addSimpleEffect(ENET_EFFECT_PS_NEWTRACKSMOKE5)
- end
- waitDeath(unit:addMoveEffect(ENET_EFFECT_MOVE_LINEAR,100))
- for i = 0,2 do
- if(unit:getScale() < 1.0) then
- steps[i]:destroy()
- else
- steps[i]:setTransformOwner()
- steps[i]:suspendedDestroy(70)
- end
- stepsmoke[i]:suspendedDestroy(5)
- end
- sound:destroy()
- end
-
- function units_lbot_fire()
- local unit = uniGetExecutor()
- wait_for_platform(unit)
- uniSetLife(uniGetLife() / 3.0)
- local gt = unit:getBone(ENBT_GUNTOWER)
- local sound = gt:play3DSound("smallrobot_guntower_rotate.wav",1)
- waitDeath(gt:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERTOTARGET,MATH_PI,uniGetTarget()))
- sound:stopSound()
- local firespot = gt:getBone(ENBT_FIRE1)
- waitDeath(gt:aimGun(0,MATH_PI / 3.0,uniGetTarget()))
- local i = 0
- for i = 0,2 do
- gt:play3DSound("smallrobot_fire.wav",0):destroy()
- local shot1 = firespot:addBulletEffect(ENET_EFFECT_BULLET_BLUELASERBOLT)
- shot1:executeCommand(ENC_FIRE1)
- gt:gunRecoil(0,0.1,4)
- pause(0.1)
- end
- unit:addFireArrow()
- end
-
- registerCommand(ENSCRIPTSET_SMALLROBOT,ENC_MOVE,"units_lbot_move")
- registerCommand(ENSCRIPTSET_SMALLROBOT,ENC_FIRE1,"units_lbot_fire")
- registerCommand(ENSCRIPTSET_SMALLROBOT,ENC_FIRE2,"units_lbot_fire")
- registerCommand(ENSCRIPTSET_SMALLROBOT,ENC_SELECT,"units_lbot_select")
- registerCommand(ENSCRIPTSET_SMALLROBOT,ENC_SELECTENEMY,"units_lbot_selectenemy")
- registerCommand(ENSCRIPTSET_SMALLROBOT,ENC_UNSELECT,"units_lbot_unselect")
- registerCommand(ENSCRIPTSET_SMALLROBOT,ENC_SETUP,"units_lbot_setup")
- registerCommand(ENSCRIPTSET_SMALLROBOT,ENC_RESETUP,"units_lbot_resetup")
- registerCommand(ENSCRIPTSET_SMALLROBOT,ENC_DAMAGED,"units_lbot_damaged")
- registerCommand(ENSCRIPTSET_SMALLROBOT,ENC_EXPLODE,"units_lbot_explode")
- registerCommand(ENSCRIPTSET_SMALLROBOT,ENC_HIGHLIGHT,"units_lbot_highlight")
- registerCommand(ENSCRIPTSET_SMALLROBOT,ENC_INSIDE,"units_inside")
-
- -- make description of unit
- desc = getEffectDescriptionP(ENET_UNIT_SMALLROBOT)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "smallrobot.rmd"
- desc.ScriptSet = ENSCRIPTSET_SMALLROBOT
- desc.MoveType = ENMOVE_GROUNDORIENTED
- desc.RenderType = ENRENDERTYPE_GEOMETRY
- desc.Material = ENMAT_RIGIDSKINNEDMESH
- desc.MaterialColors = units_materialcolors_human
-
- -- shadow
- desc = getEffectDescriptionP(ENET_EFFECT_GEOMETRY_SMALLROBOTSHADOW)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "smallrobot_shadow.rmd"
- desc.RenderType = ENRENDERTYPE_SHADOW
- desc.Material = ENMAT_SHADOW
- desc.MaterialColors = units_materialcolors_shadow
-
- -- register new unit to logic
- unitDesc = logic_getUnitDescP(0)
- unitDesc.group = 0
- unitDesc.order = 0
- unitDesc.unit_res_id = ENET_UNIT_SMALLROBOT
- unitDesc.unit_icon_id = "Smallrobot_h_small_normal.dds"
- unitDesc.active_id = "Smallrobot_h_small_active.dds"
- unitDesc.pressed_id = "Smallrobot_h_small_pressed.dds"
- unitDesc.big_icon_id = "Smallrobot_h_big_normal.dds"
- unitDesc.small_icon_id = "Smallrobot_u_stats.dds"
- unitDesc.HP = 4
- unitDesc.MP = 10
- unitDesc.WR = 1
- unitDesc.min_WR = 1
- unitDesc.WD = 1
- unitDesc.WR2 = 0
- unitDesc.min_WR2 = 0
- unitDesc.WD2 = 0
- unitDesc.ability = 0
- unitDesc.transport = 0
- unitDesc.value = 1
- unitDesc.race = 0
- unitDesc.fire_pause = 0.2
- unitDesc.move_pause = 0.5
- unitDesc.unit_info_scale = 0.08
- unitDesc.scn_name = "LBOT"
-
- ------------------------------------------------------------------------------------------------------
- ------------------------ effects related to unit------------------------------------------------------
- ------------------------------------------------------------------------------------------------------
-
- function bullets_bluelaserbolt_fire()
- local bullet = uniGetExecutor()
- bullet:setTransformOwner()
- local light = bullet:addSimpleEffect(ENET_EFFECT_LIGHT_BLUELASERBOLTFLY)
- local track = bullet:addSimpleEffect(ENET_EFFECT_PS_BLUELASERBOLT)
- waitDeath(bullet:addMoveEffect(ENET_EFFECT_MOVE_LINEARFLY,400,uniGetTarget()),1000)
- light:destroy()
- track:destroy()
- local hit_ps = bullet:addSimpleEffect(ENET_EFFECT_PS_BLUELASERBOLTHIT)
- pause(0.2)
- hit_ps:suspendedDestroy(1.0)
- uniGetTarget():executeCommand(ENC_DAMAGED)
- pause(1.0)
- bullet:destroy()
- end
-
- registerCommand(ENSCRIPTSET_BULLET_BLUELASERBOLT,ENC_FIRE1,"bullets_bluelaserbolt_fire")
-